import {Type} from "class-transformer";

import {ApiProperty} from "@nestjs/swagger";

import {SurveyEntity} from "../entities/Survey.entity";
import {QuestionEntity} from "../entities/Question.entity";
import {CreateQuestionDto} from "./CreateQuestionDto";
import {CreateSurveyDto} from "./CreateSurveyDto";

export class CreateSurveyQuestionDto {
  id: string

  @ApiProperty({example: '', description: '问卷id'})
  surveyId: string;

  @ApiProperty({example: '', description: '问题id'})
  questionId: string;

  @ApiProperty({example: '', description: '问题排序'})
  surveyOrder: number;

  @ApiProperty({type: () => CreateQuestionDto, description: '问题'})
  @Type(() => CreateQuestionDto)
  question: QuestionEntity;

  @Type(() => CreateSurveyDto)
  survey: SurveyEntity;

}
